Skip to content

Conversation

@paulb777
Copy link
Member

@andrewheard Feel free to merge if close or useful.

@gemini-code-assist
Copy link
Contributor

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

@google-oss-bot
Copy link

1 Warning
⚠️ Did you forget to add a changelog entry? (Add #no-changelog to the PR description to silence this warning.)

Generated by 🚫 Danger

@paulb777
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a great improvement, replacing fatalError calls with proper error handling through a new DecodingError enum. This makes the Generable decoding much more robust. The addition of a comprehensive test suite is also a valuable contribution, covering various success and failure scenarios for decoding. My feedback focuses on a few minor points: removing a couple of leftover TODO comments, simplifying some code for better clarity, and removing a redundant test case.

@paulb777
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request is a significant improvement, addressing TODOs by replacing fatalError calls with proper, typed error handling. The introduction of ModelOutput.DecodingError and its usage throughout the Generable initializers makes the decoding process more robust. The addition of a comprehensive test suite in GenerableTests.swift is excellent, covering success cases, various error conditions, and schema validation. My feedback includes a few suggestions to further refine error reporting for numeric conversions to be more descriptive, and a minor cleanup to remove a redundant check.

@paulb777 paulb777 force-pushed the pb-tests-todos branch 4 times, most recently from 59c70a6 to bcd9e06 Compare November 25, 2025 22:52
@paulb777
Copy link
Member Author

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This is an excellent pull request that significantly improves the robustness and test coverage of the codebase. Replacing fatalError with proper error handling is a crucial change, and the new DecodingError enum is well-designed. The addition of comprehensive unit tests for various decoding scenarios, including nested objects and error conditions, is a great contribution. The code is now cleaner and more reliable. I have one minor suggestion to make a test assertion more robust.

_ = try Person(modelOutput)
Issue.record("Did not throw an error.")
} catch let GenerativeModel.GenerationError.decodingFailure(context) {
#expect(context.debugDescription.contains("\"forty\" does not contain Int"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

The assertion on the debugDescription of the error seems to be checking for a substring that won't be present. The decodingFailure helper creates a message like FirebaseAILogic.ModelOutput does not contain Int.\nContent: "forty". The current check for \"forty\" does not contain Int will likely fail. It's better to check for the relevant parts of the error message separately to make the test more robust.

#expect(context.debugDescription.contains("does not contain Int") && context.debugDescription.contains("\"forty\""))

@andrewheard andrewheard merged commit 5cafb19 into ah/ai-generable-macro Nov 26, 2025
53 of 59 checks passed
@andrewheard andrewheard deleted the pb-tests-todos branch November 26, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants